Adjust constants used for sRGB gamma
authorØyvind Kolås <pippin@gimp.org>
Thu, 23 Aug 2012 08:26:29 +0000 (10:26 +0200)
committerØyvind Kolås <pippin@gimp.org>
Thu, 23 Aug 2012 08:31:36 +0000 (10:31 +0200)
Spotted by Elle Stone and clarified by Graeme Gill, now updated to Current IEC
specification values.

babl/base/util.h

index edb310522c91d3e7a2aa1dbeade3301f0272d99a..6888ddc2f35efdf787455c12d19c8263ecc3b34a 100644 (file)
@@ -60,11 +60,11 @@ static inline double
 linear_to_gamma_2_2 (double value)
 {
 #if 0
-  if (value > 0.0030402477F)
+  if (value > 0.003130804954)
     return 1.055F * pow (value, (1.0F/2.4F)) - 0.055F;
   return 12.92F * value;
 #else
-  if (value > 0.0030402477F)
+  if (value > 0.003130804954)
     return 1.055F * babl_pow_1_24 (value) - 0.055F;
   return 12.92F * value;
 #endif
@@ -74,11 +74,11 @@ static inline double
 gamma_2_2_to_linear (double value)
 {
 #if 0
-  if (value > 0.03928F)
+  if (value > 0.04045F)
     return pow ((value + 0.055F) / 1.055F, 2.4F);
   return value / 12.92F;
 #else
-  if (value > 0.03928F)
+  if (value > 0.04045F)
     return babl_pow_24 ((value + 0.055F) / 1.055F);
   return value / 12.92F;
 #endif